package cn.lwalan.commonUtils;


import java.text.ParseException;

/**
 * @Auther: Alan liu
 * @Date: 2019/2/14 15:37
 * @Description:
 */
public class SafetyDateUtilTest {

    public static class TestSimpleDateFormatThreadSafe extends Thread {
        @Override
        public void run() {
            while(true) {
                try {
                    //等待2000ms后一起执行
                    this.join(2000);
                } catch (InterruptedException e1) {
                    e1.printStackTrace();
                }
                try {
                    System.out.println(this.getName()+":"+SafetyDateUtil.parse("2013-05-24 06:02:20"));
                } catch (ParseException e) {
                    e.printStackTrace();
                }
            }
        }
    }


    public static void main(String[] args) {
        for(int i = 0; i < 3; i++){
            new TestSimpleDateFormatThreadSafe().start();
        }
        System.out.println(System.currentTimeMillis());

    }

}